﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;


namespace ZGameFramework
{
    public class GameFrameworkParamFactory
    {
        public static GameFrameworkParam CreateParam()
        {
            return new GameFrameworkParam();
        }

        public static GameFrameworkParam CreateParam<T>(T _p)
        {
            GameFrameworkParam1<T> param = new GameFrameworkParam1<T>();
            param.SetParam(_p);
            return param;
        }

        public static GameFrameworkParam CreateParam<T1, T2>(T1 _p1, T2 _p2)
        {
            GameFrameworkParam2<T1, T2> param = new GameFrameworkParam2<T1, T2>();
            param.SetParam(_p1, _p2);
            return param;
        }

        public static GameFrameworkParam CreateParam<T1, T2, T3>(T1 _p1, T2 _p2, T3 _p3)
        {
            GameFrameworkParam3<T1, T2, T3> param = new GameFrameworkParam3<T1, T2, T3>();
            param.SetParam(_p1, _p2, _p3);
            return param;
        }

        public static GameFrameworkParam CreateParam<T1, T2, T3, T4>(T1 _p1, T2 _p2, T3 _p3, T4 _p4)
        {
            GameFrameworkParam4<T1, T2, T3, T4> param = new GameFrameworkParam4<T1, T2, T3, T4>();
            param.SetParam(_p1, _p2, _p3, _p4);
            return param;
        }

        public static GameFrameworkParam CreateParam<T1, T2, T3, T4, T5>(T1 _p1, T2 _p2, T3 _p3, T4 _p4, T5 _p5)
        {
            GameFrameworkParam5<T1, T2, T3, T4, T5> param = new GameFrameworkParam5<T1, T2, T3, T4, T5>();
            param.SetParam(_p1, _p2, _p3, _p4, _p5);
            return param;
        }

        public static GameFrameworkParam CreateParam<T1, T2, T3, T4, T5,T6>(T1 _p1, T2 _p2, T3 _p3, T4 _p4, T5 _p5, T6 _p6)
        {
            GameFrameworkParam6<T1, T2, T3, T4, T5, T6> param = new GameFrameworkParam6<T1, T2, T3, T4, T5, T6>();
            param.SetParam(_p1, _p2, _p3, _p4, _p5, _p6);
            return param;
        }


    }

    /// <summary>
    /// 多变量
    /// </summary>
    public class GameFrameworkParam
    {
        public void SetParam()
        { }
        public virtual void Clear()
        { }
    }

    /// <summary>
    /// T 变量1
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class GameFrameworkParam1<T> : GameFrameworkParam
    {
        public T p = default(T);

        public void SetParam( T _p )
        {
            p = _p;
        }
        public override void Clear()
        {
            p = default(T);
        }
    }
    
    /// <summary>
    /// T1 变量1
    /// T2 变量2
    /// </summary>
    /// <typeparam name="T1"></typeparam>
    /// <typeparam name="T2"></typeparam>
    public class GameFrameworkParam2<T1, T2> : GameFrameworkParam
    {
        public T1 p1 = default(T1);
        public T2 p2 = default(T2);

        public void SetParam(T1 _p1, T2 _p2)
        {
            p1 = _p1;
            p2 = _p2;
        }
        public override void Clear()
        {
            p1 = default(T1);
            p2 = default(T2);
        }
    }

    /// <summary>
    /// T1 变量1 
    /// T2 变量2
    /// T3 变量3
    /// </summary>
    /// <typeparam name="T1"></typeparam>
    /// <typeparam name="T2"></typeparam>
    /// <typeparam name="T3"></typeparam>
    public class GameFrameworkParam3<T1, T2, T3> : GameFrameworkParam
    {
        public T1 p1 = default(T1);
        public T2 p2 = default(T2);
        public T3 p3 = default(T3);

        public void SetParam(T1 _p1, T2 _p2, T3 _p3)
        {
            p1 = _p1;
            p2 = _p2;
            p3 = _p3;
        }
        public override void Clear()
        {
            p1 = default(T1);
            p2 = default(T2);
            p3 = default(T3);
        }
    }

    /// <summary>
    /// T1 变量1 
    /// T2 变量2
    /// T3 变量3
    /// T4 变量4
    /// </summary>
    /// <typeparam name="T1"></typeparam>
    /// <typeparam name="T2"></typeparam>
    /// <typeparam name="T3"></typeparam>
    /// <typeparam name="T4"></typeparam>
    public class GameFrameworkParam4<T1, T2, T3, T4> : GameFrameworkParam
    {
        public T1 p1 = default(T1);
        public T2 p2 = default(T2);
        public T3 p3 = default(T3);
        public T4 p4 = default(T4);

        public void SetParam(T1 _p1, T2 _p2, T3 _p3, T4 _p4)
        {
            p1 = _p1;
            p2 = _p2;
            p3 = _p3;
            p4 = _p4;
        }
        public override void Clear()
        {
            p1 = default(T1);
            p2 = default(T2);
            p3 = default(T3);
            p4 = default(T4);
        }
    }

    /// <summary>
    /// T1 变量1 
    /// T2 变量2
    /// T3 变量3
    /// T4 变量4
    /// T5 变量5
    /// </summary>
    /// <typeparam name="T1"></typeparam>
    /// <typeparam name="T2"></typeparam>
    /// <typeparam name="T3"></typeparam>
    /// <typeparam name="T4"></typeparam>
    /// <typeparam name="T5"></typeparam>
    public class GameFrameworkParam5<T1, T2, T3, T4, T5> : GameFrameworkParam
    {
        public T1 p1 = default(T1);
        public T2 p2 = default(T2);
        public T3 p3 = default(T3);
        public T4 p4 = default(T4);
        public T5 p5 = default(T5);

        public void SetParam(T1 _p1, T2 _p2, T3 _p3, T4 _p4, T5 _p5)
        {
            p1 = _p1;
            p2 = _p2;
            p3 = _p3;
            p4 = _p4;
            p5 = _p5;
        }
        public override void Clear()
        {
            p1 = default(T1);
            p2 = default(T2);
            p3 = default(T3);
            p4 = default(T4);
            p5 = default(T5);
        }
    }

    /// <summary>
    /// T1 变量1 
    /// T2 变量2
    /// T3 变量3
    /// T4 变量4
    /// T5 变量5
    /// T6 变量6
    /// </summary>
    /// <typeparam name="T1"></typeparam>
    /// <typeparam name="T2"></typeparam>
    /// <typeparam name="T3"></typeparam>
    /// <typeparam name="T4"></typeparam>
    /// <typeparam name="T5"></typeparam>
    /// <typeparam name="T6"></typeparam>
    public class GameFrameworkParam6<T1, T2, T3, T4, T5, T6> : GameFrameworkParam
    {
        public T1 p1 = default(T1);
        public T2 p2 = default(T2);
        public T3 p3 = default(T3);
        public T4 p4 = default(T4);
        public T5 p5 = default(T5);
        public T6 p6 = default(T6);

        public void SetParam(T1 _p1, T2 _p2, T3 _p3, T4 _p4, T5 _p5, T6 _p6)
        {
            p1 = _p1;
            p2 = _p2;
            p3 = _p3;
            p4 = _p4;
            p5 = _p5;
            p6 = _p6;
        }

        public override void Clear()
        {
            p1 = default(T1);
            p2 = default(T2);
            p3 = default(T3);
            p4 = default(T4);
            p5 = default(T5);
            p6 = default(T6);
        }
    }
}
